from pyevent import Worker


class CrawlJob(Worker):
    def run(self, event_type):
        res = ''
        if event_type == 'crawl_sina':
            print('crawl from sina')
            res = 'result: crawl from sina'
        elif event_type == 'crawl_tencent':
            print('crawl from tencent')
            res = 'result: crawl from tencent'
        else:
            print('unknown event type: {}'.format(event_type))
            res = 'result: unknown event type: {}'.format(event_type)
        return res
